#include <dao.h>
#include <btBulletDynamicsCommon.h>

#include "btMotionState.h"
#include "btDefaultMotionState.h"

static void construct(DaoContext *ctx, DValue *p[], int N) {
    btTransform			*start = (btTransform*) DaoCData_GetData(p[0]->v.cdata);
    btDefaultMotionState	*ptr = new btDefaultMotionState(*start);

    DaoCData *cdata = DaoContext_PutCData(ctx, ptr, &btDefaultMotionStateTyper);
};

static void destruct(void *self) {
    delete (btDefaultMotionState*) self;
}

static DaoFuncItem meth[] = {
    { construct,	"btDefaultMotionState(start:btTransform)" },
    { NULL, NULL }
};

DaoTypeBase btDefaultMotionStateTyper = {
    "btDefaultMotionState",
    NULL,
    NULL,               		/* constant */
    meth,       			/* methods */
    { &btMotionStateTyper, NULL },     	/* parent type */
    { NULL },
    destruct,
    NULL
};
